<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
</head>

<body>
    <div id="app">
        <img src="./img/01.jpg" @mouseover="mouseOver" @mouseleave="mouseLeave" :style="{'opacity':opacity}" width="300">
    </div>

    <script>
        var app = new Vue({
            el: "#app",
            data: {
                opacity: 1
            },
            methods: {
                mouseOver() {
                    this.opacity = 0.5
                },
                mouseLeave() {
                    this.opacity = 1
                }
            }
        })
    </script>

</body>

</html>